package com.qq.xrx1002.androidgame;

import org.cocos2d.actions.instant.CCCallFunc;
import org.cocos2d.actions.interval.CCDelayTime;
import org.cocos2d.actions.interval.CCSequence;

/**
 * Created by Alyson on 2018/11/14.
 */

public class Repeater extends ShooterPlant {//豌豆射手
    public Repeater() {
        //number表示图片又多少帧就写多少的数字
        super("plant/Repeater/Frame%02d.png", 15);
        setPrice(200);
    }

    @Override
    public void createBullet(float t) {
        PeaBullet peaBullet=new PeaBullet(this);
        CCDelayTime ccDelayTime=CCDelayTime.action(0.5f);//隔0.5秒再发出一个子弹
        CCCallFunc ccCallFunc=CCCallFunc.action(this,"createBulletTwo");
        CCSequence ccSequence=CCSequence.actions(ccDelayTime,ccCallFunc);
        runAction(ccSequence);
    }
    public void createBulletTwo(){
        PeaBullet peaBullet=new PeaBullet(this);
    }
}
